package zjh.msg.entity;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Msg {
    private String id;
    private String nickname;
    private String qq;
    private String email;
    private String text;
    private String replyId;
    private LocalDateTime createTime;
    private String formattedTime;

    public String getFormattedTime() {
        this.formattedTime = this.createTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
        return formattedTime;
    }

    public void setFormattedTime(String formattedTime) {
        this.formattedTime = formattedTime;
    }

    public Msg(String id, String nickname, String qq, String email, String text, String replyId, LocalDateTime createTime) {
        this.id = id;
        this.nickname = nickname;
        this.qq = qq;
        this.email = email;
        this.text = text;
        this.replyId = replyId;
        this.createTime = createTime;
    }

    public Msg() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getReplyId() {
        return replyId;
    }

    public void setReplyId(String replyId) {
        this.replyId = replyId;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Msg{" +
                "id='" + id + '\'' +
                ", nickname='" + nickname + '\'' +
                ", qq='" + qq + '\'' +
                ", email='" + email + '\'' +
                ", text='" + text + '\'' +
                ", replyId='" + replyId + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
